package com.godyao.mall.goods.api.feign;

import com.godyao.mall.core.model.ResultMsg;
import com.godyao.mall.core.model.goods.Goods;
import com.godyao.mall.goods.api.feign.fallback.GoodsFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author godyao
 * @date 2022/4/3
 */
@FeignClient(value = "mall-goods", contextId = "mall-goods", fallback = GoodsFeignFallback.class)
public interface GoodsFeign {
    /**
     * 根据商品id查找商品信息
     * @param goodsId
     * @return
     */
    @GetMapping("/mall-goods/front/goods/{goodsId}")
    ResultMsg<Goods> findGoodsByGoodsId(@PathVariable(value = "goodsId") Long goodsId);
}
